//
//  QDDefineHeader.h
//  QuDanOEM
//
//  Created by xiaohuang on 2021/10/18.
#ifndef QDDefineHeader_h
#define QDDefineHeader_h
#define WEAKSELF __weak typeof(self) weakSelf = self;
#define kWindow [UIApplication sharedApplication].delegate.window
#define QD_COLOR_RGB(a,b,c,d) [UIColor colorWithRed:a/255.0 green:b/255.0 blue:c/255.0 alpha:d]
#define QD_RGB(A,B,C) [UIColor colorWithRed:A/255.0 green:B/255.0 blue:C/255.0 alpha:1.0]
#define QD_RGBA(A,B,C,D) [UIColor colorWithRed:A/255.0 green:B/255.0 blue:C/255.0 alpha:D]
#define QD_IS_EMPTY(str) (str == nil || str == NULL || [str length] == 0 )
#define HEXCOLOR(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define HEXCOLORAL(rgbValue, al) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:al]
#define HexColor(hexString)  [UIColor colorWithHexString:hexString]
#define QD_MainThemColor  HEXCOLOR(0xF76307)
#define FONT_PFRG_SIZE(s) [UIFont systemFontOfSize:s]
#define QD_IPHONE_HEIGHT [UIScreen mainScreen].bounds.size.height
#define QD_IPHONE_WIDTH [UIScreen mainScreen].bounds.size.width
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IOS_11  ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.f)
#define IS_IPHONE_X2 (IS_IOS_11 && IS_IPHONE && (MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 375 && MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 812))
#define Height_X ((IS_IPHONE_X2 == YES) ? 34.0 : 0)
#define Height_StatusBar ((IS_IPHONE_X2 == YES) ? 44.0 : 20.0)
#define Height_NavBar ((IS_IPHONE_X2 == YES) ? 88.0 : 64.0)
#define Height_TabBar ((IS_IPHONE_X2 == YES) ? 83.0 : 49.0)
#endif /* QDDefineHeader_h */
